]> git.r.bdr.sh - rbdr/super-polarity/blobdiff - Super Polarity/BasicGenerator.cs
Proper merge for gitignore
[rbdr/super-polarity] / Super Polarity / BasicGenerator.cs
index 7cc45449d0e9179985c380b21f4de2e45b791b3f..ba517424dae1834e1d6fcd192e374dfd83829083 100644 (file)
@@ -26,11 +26,17 @@ namespace SuperPolarity
             Rate = rate;
             Randomizer = new Random();
             Position = position;
+            CurrentTime = rate;
         }
 
         public void Update(GameTime gameTime)
         {
-            if (Game.Player.Score > ScoreThreshold)
+            if (ActorManager.CountBaddies() > 50)
+            {
+                return;
+            }
+
+            if (Game.Player.Score >= ScoreThreshold)
             {
                 CurrentTime = CurrentTime + gameTime.ElapsedGameTime.Milliseconds;
 
@@ -53,17 +59,17 @@ namespace SuperPolarity
 
             if (ShipType == Ships.Ship)
             {
-                ActorFactory.CreateShip(polarity, Position);
+                Renderer.CheckIn(ActorFactory.CreateShip(polarity, Position));
             }
 
             if (ShipType == Ships.Scout)
             {
-                ActorFactory.CreateScout(polarity, Position);
+                Renderer.CheckIn(ActorFactory.CreateScout(polarity, Position));
             }
 
             if (ShipType == Ships.Battlecruiser)
             {
-                ActorFactory.CreateCruiser(polarity, Position);
+                Renderer.CheckIn(ActorFactory.CreateCruiser(polarity, Position));
             }
 
         }